home *** CD-ROM | disk | FTP | other *** search
/ Professor Fernleaf from the Tropics / Professor Fernleaf from the Tropics.iso / pc / program / xtras / popup.x32 / TEXT / TEXT_CASTSCRIPT next >
Text File  |  1998-08-11  |  3KB  |  76 lines

  1. ---------------------------------------------------
  2. -------------- on menuItemSelected ----------------
  3. ---------------------------------------------------
  4.  
  5. -- The Popup Xtra castmember will send the "menuItemSelected" event to Director
  6. -- whenever a valid menu selection has been made.
  7. --
  8. -- The menuItemSelected event is sent when one of the following occurs:
  9. -- (1) The user clicks the mouse on the Popup Xtra sprite, selects an item and
  10. --    then releases the mouse button (and the trapEvents property has been set to TRUE
  11. --    either through scripting or the Castmember Properties dialog), or
  12. -- (2) The Activate() command has been explicitly called and the user selects an item and
  13. --    then releases the mouse button.
  14. --
  15. -- NOTE: If you are using the activateMenu command, *always* set the trapsEvents property
  16. -- to FALSE, which can be done in the Castmember Properties dialog or through scripting.
  17. -- This will allow your scripting to control the appearance of the menu and not Director.
  18.  
  19. -- Arguments:
  20. -- me:         the Popup Xtra sprite that was used to make the selection
  21. -- menuSpec:   the selected item's menu specification (the selectedSpec property)
  22. -- menuText:   the selected item's text (the selectedText property)
  23. -- memberRef:  the Popup Xtra castmember that was used to make the selection
  24.  
  25. on menuItemSelected me, menuSpec, menuText, memberRef
  26.   -- your Lingo code goes here
  27. end
  28.  
  29.  
  30. -- TIPS:
  31.  
  32. -- The menuItemSelected event sent first to the sprite. If no sprite script or behavior
  33. -- is attached which processes this event, then the event is sent to this castmember script.
  34. -- The order of calling this handler is as follows:
  35. -- Sprite script-->Cast script-->Frame script-->Movie Script
  36.  
  37. -- So, if you want to have the same Popup Xtra castmember used for numerous sprites, you
  38. -- need to add this event handler to the sprite script (the castmember handler will never get
  39. -- called if there is a sprite script event handler for the menuItemSelected event.)
  40.  
  41. -- If you want to have a movie handler control *all* of the Popup Xtra interactions, you can
  42. -- comment out the menuItemSelected handler from all of the castmember scripts and add one to
  43. -- the movie script instead. You can then examine the memberRef argument to determine which
  44. -- menu was selected.
  45.  
  46.  
  47. ---------------------------------------------------
  48. -------------- on mouseDown -----------------------
  49. ---------------------------------------------------
  50.  
  51. -- This will be invoked *before* the menu is activated.
  52. -- If you want to trigger the popup menu upon certain conditions, such as only if the
  53. -- control key is held down, you would call the activateMenu command to do this.
  54. -- NOTE: If you are calling the activateMenu command, *always* set the trapsEvents property
  55. -- to FALSE, which can be done in the Castmember Properties dialog or through scripting.
  56. --
  57. -- TIP:  If you are converting scripts used with previous versions of Popup Xtra,
  58. --       you should convert the mouseDown handlers to menuItemSelected handlers to
  59. --       get the best experience across all platforms and operating system versions.
  60.  
  61. on mouseDown
  62.   
  63. end mouseDown
  64.  
  65.  
  66. ---------------------------------------------------
  67. -------------- on mouseUp -------------------------
  68. ---------------------------------------------------
  69.  
  70. -- This will be invoked *after* the menu has been selected from or activated.
  71.  
  72. on mouseUp
  73.   
  74. end mouseUp
  75.  
  76.